﻿<%@ Assembly Name="Microsoft.SharePoint.ApplicationPages, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Page Language="C#" MasterPageFile="~/_layouts/application.master" Inherits="de.rwth.rz.campus.Mailer.GroupMailerSettings, GroupMailer.Mailer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4608e1918bccf685" %>

<%@ Register TagPrefix="wssawc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0,  Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="spuc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="System.Xml" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" Src="~/_controltemplates/ButtonSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" Src="~/_controltemplates/InputFormControl.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection" Src="~/_controltemplates/InputFormSection.ascx" %>

<script runat="server">
    uint lang = SPContext.Current.Web != null ? SPContext.Current.Web.Language : 1031;
    string breadcrumbListLink = string.Empty;
    string breadcrumbWebLink = string.Empty;
    string breadcrumbSettingsLink = string.Empty;
    SPList List = null;
    SPWeb Web;

    public void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            //provisioning bread crumb
            using (SPWeb web = SPContext.Current.Web)
            {
                //get the list ID stored before Postback
                List = web.Lists[new Guid(listid.Value)];
                //server side step to provision the bread crumb.
                breadcrumbWebLink = "<a href='" + web.Url + "'>" + web.Title + "</a>";
                breadcrumbListLink = "<a href='" + Microsoft.SharePoint.Utilities.SPUrlUtility.CombineUrl(web.Url, List.RootFolder.Url) + "'>" + List.Title + "</a>";
                breadcrumbSettingsLink = "<a href='" + web.Url + "/_layouts/listedit.aspx?List={" + listid.Value + "}'>" + SPUtility.GetLocalizedString("$Resources:Mailer,BCSettings", "Mailer", lang) + "</a>";
            }
            return;
        }

        using (SPWeb web = SPContext.Current.Web)
        {
            List = web.Lists[new Guid(Request.QueryString["List"])];
            //provisioning bread crumb
            breadcrumbWebLink = "<a href='" + web.Url + "'>" + web.Title + "</a>";
            breadcrumbListLink = "<a href='" + SPUrlUtility.CombineUrl(web.Url, List.RootFolder.Url) + "'>" + List.Title + "</a>";
            breadcrumbSettingsLink = "<a href='" + web.Url + "/_layouts/listedit.aspx?List={" + List.ID + "}'>" + SPUtility.GetLocalizedString("$Resources:Mailer,BCSettings", "Mailer", lang) + "</a>";
            //storing the list ID to be retrieved after Postback in order to build bread crumb.
            listid.Value = List.ID.ToString();
        }
    }

    protected override void RenderChildren(HtmlTextWriter output)
    {
        LiteralControl myBreadcrumb = new LiteralControl(breadcrumbWebLink + " > " + breadcrumbListLink + " > " + breadcrumbSettingsLink + " > " + SPUtility.GetLocalizedString("$Resources:Mailer,BCProject", "Mailer", lang));
        Master.FindControl("PlaceHolderTitleBreadcrumb").FindControl("ContentMap").Controls.Add(myBreadcrumb);
        base.RenderChildren(output);
    }
   </script>

<asp:Content ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    <SharePoint:EncodedLiteral runat="server" Text="<%$Resources:MailerGlobal,BCProject%>"
        EncodeMethod="HtmlEncode" />
</asp:Content>
<asp:Content ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server">
    <SharePoint:FormattedStringWithListType ID="FormattedStringWithListType1" runat="server"
        String="<%$Resources:MailerGlobal,TitleInTitle%>" LowerCase="false" />
    <a id="onetidListHlink" href="<% SPHttpUtility.AddQuote(SPHttpUtility.UrlPathEncode(List.DefaultViewUrl,true),Response.Output);%>">
        <%SPHttpUtility.HtmlEncode(List.Title, Response.Output);%></a>
</asp:Content>
<asp:Content ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <style type="text/css">
        table.ms-propertysheet
        {
            height: 100%;
        }
    </style>
    <table cellspacing="0" cellpadding="0" border="0" class="ms-settingsframe" width="100%">
        <tr>
            <td valign="top" style="padding: 4px 0px 4px 0px;" height="100%">
                <table border="0" cellspacing="0" cellpadding="0" class="ms-propertysheet" width="100%">
                    <colgroup>
                        <col style="width: 40%"></col>
                        <col style="width: 60%"></col>
                    </colgroup>
                    <tr>
                        <td>
                            <wssuc:InputFormSection runat="server" Title="<%$Resources:MailerGlobal,Config_Title%>" Description="<%$Resources:MailerGlobal,Config_ItemDesc%>">
                                <template_inputformcontrols>
			    <wssuc:InputFormControl runat="server" LabelText="<%$Resources:MailerGlobal,Config_Desc%>" LabelAssociatedControlId="InputFormRadioButton1" >
				<Template_Control>
				  <div class="ms-authoringcontrols">
				    <spuc:InputFormRadioButton ID="InputFormRadioButton1" runat="server" GroupName ="GroupA" LabelText="Ja" />
                    <spuc:InputFormRadioButton ID="InputFormRadioButton2" runat="server" GroupName="GroupA" LabelText="Nein" />
				        </div>
				 </Template_Control>
			</wssuc:InputFormControl>
			</template_inputformcontrols>
                            </wssuc:InputFormSection>
                            <wssuc:ButtonSection runat="server" SmallSectionLine="true" TopButtons="true" BottomSpacing="5"
                                ShowSectionLine="true">
                                <template_buttons>
                <asp:Button UseSubmitBehavior="false" runat="server"
                    class="ms-ButtonHeightWidth" Text="OK"
                    id="BtnSubmitBottom" Enabled="true" OnClick="SubmitButton_Click"  />
            </template_buttons>
                            </wssuc:ButtonSection>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <input type="hidden" runat="server" id="listid" />
</asp:Content>
